package com.算法4.base;

/**
 * @description: TODO 类描述
 * @author: YUANG
 * @date: 2022/3/3
 **/
public class LineTest {
    public static void main(String[] args) {

        Node head = new Node();
        Node one = new Node();
        Node two = new Node();
        Node three = new Node();

        one.item = "one";
        two.item = "two";
        three.item = "three";

        head.next = one;
        one.next = two;
        two.next = three;

        while (head.next != null) {
            head = head.next;
            System.out.println(head.item);
        }
    }

    public static class Node {
        String item;
        Node next;
    }
}
